Page({

  /**
   * 页面的初始数据
   */
  data: {
    catalog: [
      {
        title: '视图容器viewBox',
        showCon: true,
        items: [
          {
            name: 'view',
            url: "/pages/viewBox/view/view",
          },
          {
            name: 'scroll-view',
            url: "/pages/viewBox/scroll-view/scroll-view",
          },
          {
            name: 'swiper',
            url: "/pages/viewBox/swiper/swiper",
          },
          {
            name: 'movable-view',
            url: "/pages/viewBox/movable-view/movable-view",
          },
          {
            name: 'cover-view',
            url: "/pages/viewBox/cover-view/cover-view",
          }
        ]
      },
      {
        title: '基础内容baseContent',
        showCon: true,
        items: [
          {
            name: 'icon',
            url: "/pages/baseContent/icon/icon",
          },
          {
            name: 'text',
            url: "/pages/baseContent/text/text",
          },
          {
            name: 'rich-text',
            url: "/pages/baseContent/rich-text/rich-text",
          },
          {
            name: 'progress',
            url: "/pages/baseContent/progress/progress",
          }
        ]
      },
      {
        title: '表单内容form',
        showCon: true,
        items: [
          {
            name: 'button',
            url: "/pages/form/button/button",
          },
          {
            name: 'checkbox',
            url: "/pages/form/checkbox/checkbox",
          },
          {
            name: 'input',
            url: "/pages/form/input/input",
          },
          {
            name: 'label',
            url: "/pages/form/label/label",
          },
          {
            name: 'picker',
            url: "/pages/form/picker/picker",
          },
          {
            name: 'radio',
            url: "/pages/form/radio/radio",
          },
          {
            name: 'slider',
            url: "/pages/form/slider/slider",
          },
          {
            name: 'switch',
            url: "/pages/form/switch/switch",
          },
          {
            name: 'textarea',
            url: "/pages/form/textarea/textarea",
          },
          {
            name: 'form',
            url: "/pages/form/form/form",
          }
        ]
      },
      {
        title: '导航nav',
        showCon: true,
        items: [
          {
            name: 'navigator',
            url: "/pages/nav/navigator/navigator",
          }
        ]
      },
      {
        title: '媒体组件media',
        showCon: true,
        items: [
          {
            name: 'audio',
            url: "/pages/media/audio/audio",
          },
          {
            name: 'image',
            url: "/pages/media/image/image",
          },
          {
            name: 'video',
            url: "/pages/media/video/video",
          },
          {
            name: 'camera',
            url: "/pages/media/camera/camera",
          }
        ]
      },
      {
        title: '地图map',
        showCon: true,
        items: [
          {
            name: 'map',
            url: "/pages/map/map",
          }
        ]
      },
      {
        title: '画布canvas',
        showCon: true,
        items: [
          {
            name: 'canvas',
            url: "/pages/canvas/canvas",
          }
        ]
      },
      {
        title: '开放能力openCapacity',
        showCon: true,
        items: [
          {
            name: 'web-view',
            url: "/pages/openCapacity/web-view/web-view",
          },
          {
            name: 'open-data',
            url: "/pages/openCapacity/open-data/open-data",
          }
        ]
      },
      {
        title: '自定义组件myComponents',
        showCon: true,
        items: [
          {
            name: '自定义组件',
            url: "/pages/myComponents/useComponent1/useComponent1",
          }
          
        ]
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  toggle: function (e) {
    // console.log(e)
    var index = e.target.id;
    let showConObj = 'catalog[' + index + '].showCon';
    this.setData({
      [showConObj]: !this.data.catalog[index].showCon
    })
  }
});
